package com.xiaoh.dormitoryrepairreportbackend.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 统一用户表
 */
@TableName(value = "general_user")
@Data
@Schema(description = "统一用户表")
public class GeneralUser implements Serializable {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    /**
     * 登录账号
     */
    @TableField(value = "account_name")
    @Schema(description = "登录账号")
    private String accountName;

    /**
     * 用户昵称
     */
    @TableField(value = "nick_name")
    @Schema(description = "用户昵称")
    private String nickName;

    /**
     * 密码(加密存储)
     */
    @TableField(value = "password")
    @Schema(description = "密码(加密存储)")
    private String password;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    @Schema(description = "邮箱")
    private String email;

    /**
     * 手机号码
     */
    @TableField(value = "phone_number")
    @Schema(description = "手机号码")
    private String phoneNumber;

    /**
     * 用户类型(1:学生, 2:维修工, 3:管理员)
     */
    @TableField(value = "user_type")
    @Schema(description = "用户类型(1:学生, 2:维修工, 3:管理员)")
    private Integer userType;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;

    /**
     * 逻辑删除(0:未删除, 1:已删除)
     */
    @TableField(value = "is_deleted")
    @TableLogic
    @Schema(description = "逻辑删除(0:未删除, 1:已删除)")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
